This invention relates to using and managing computer communications ports such as serial ports that are under the control of a computer operating system.
Conventional desktop or portable computers often have a communications port that uses a serial bit protocol, in which data bits are sent serially over a pair of bi-directional signal lines. Although this type of connection is perhaps not the most efficient or flexible, it is widely used because of its simplicity.
Serial ports are used for communications with a variety of different devices, such as printers, digital cameras, GPS (global positioning system) devices, personal organizers, portable or handheld computers, etc. Devices such as these are often dependent on a desktop or xe2x80x9cbasexe2x80x9d computer for realization of their full functionality. For example, a digital camera captures pictures but is not usually equipped with ways to manipulate or print the pictures. Instead, the pictures are transferred to a base computer for manipulation, printing, and long-term storage. Similarly, personal organizers often work well in conjunction with a base computerxe2x80x94rather then entering data with the limited input capabilities of the personal organizer, data can be entered at the more capable desktop computer and then downloaded to the personal organizer using a serial communications link.
Thus, many serial devices are used in conjunction with application programs that execute on the base computer. The application programs are configured respectively for the different types of serial devices. In many cases, the application programs are installed once, and are configured to execute continuously thereafter-although they may be hidden from view. For example, such xe2x80x9cbackgroundxe2x80x9d software might be used in conjunction with a personal organizer device that is only sporadically connected to the serial port of the base computer. Whenever the personal organizer is connected, the application program automatically attempts to update the data of the personal organizer. In some cases, the base computer and peripheral device are configured to xe2x80x9csynchronizexe2x80x9d their data, so that changes made in one device are automatically reflected in the other. For example, a contact database might be synchronized like this.
Portable devices running the xe2x80x9cWindows CExe2x80x9d operating system operate in this manner. A synchronization program runs continuously on a base computer, waiting for the connection of a portable device. At startup, the synchronization program interacts with the xe2x80x9cWindowsxe2x80x9d operating system to obtain exclusive use of the base computer""s serial port. Thereafter, it monitors input from the serial port (in conjunction with the operating system) to detect when a compatible portable device is connected. In this environment, compatible devices are configured to identify themselves by automatically transmitting a predefined character string upon connection to the serial port of the base computer. This notifies the sychronization program that the portable device has been connected and that it is ready to receive further instructions.
The synchronization program thus monopolizes the serial port for its own purposes. Although this is acceptable in many situations, it can create problems when a user wants to use or share the serial port for another purpose-such as for communications with a different type of device. For example, suppose the user installs a new program on the base computer for communicating with a digital camera. Upon startup, the new program requests use of the serial port from the operating system. However, the serial port is already in use by the previously installed synchronization program. Accordingly, the operating system refuses the request from the new program, and the new program typically terminates with some type of error message.
Before the new program can function correctly, it is necessary in most cases to terminate the program that is already using the serial port. Although this should be a simple matter, it can be difficult to identify exactly what has caused the problem. Specifically, the user does not always recall which program might be using the serial port.
It would be convenient in this situation for the new program to more specifically identify the source of the problem, such as by identifying the previously installed program that is using the serial port. However, this information is typically unavailable either to the new program or to the operating system itself Thus, the new program usually is able only to state something like xe2x80x9cThe port is already in use by another program.xe2x80x9d This is often of little help to the user.
Furthermore, even an identification of the previously installed program is of little use in some situations, since it is not always apparent how to terminate the offending program.
The invention described below addresses this situation, providing a convenient way for different programs to use the same serial port with different peripherals, without requiring detailed knowledge on the part of the computer user.
Described below is an application program configured to use a serial port for communications with a compatible type of peripheral device. The application program monitors the serial port to detect when a peripheral device is connected. Upon detecting a peripheral device connection, the application program determines whether the connected device is of the type with which the application program is designed to communicate. If it is not, the application program offers to relinquish control of the serial port so that another program can use the serial port for communications with the newly connected peripheral device. If the application program is activated later, it asks the user if he or she wishes to have the application program resume control of the serial port.